how to determine if a function is differentiable